<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <title>Home</title>
  <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all" />
  <script src="js/jquery.min.js"></script>
  <link href="css/style.css" rel="stylesheet" type="text/css" media="all" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
  <script src="js/modernizr.custom.js"></script>
  <link rel="stylesheet" type="text/css" href="css/component.css" />
  <style>
    .cyspan{
      color: #1900ff;
    border: 1px solid #eeff00;
    font-size: 30px;
    margin: 5px;
    width: 50px;
    display: inline-block;
    text-align: center;
    padding: 0 5px;
    background: #eeff00;
    font-family: 幼圆;
    }
  </style>
<script>
function cy(currentSpan){
    if($("#resultMessage").text().indexOf("组装失败")!=-1){
      $("#cytext").val("");
      $("#resultMessage").text("")
    }
    var currentSpanText = $(currentSpan).text();
    var cytext = $("#cytext").val();
    $("#cytext").val(cytext+currentSpanText);
}
</script>
</head>
<body>
<!--header-->
<div class="header" >


  <div class="header-top">
    <div class="container">
      <div class="head-top">
        <div class="logo">

          <h1>游戏中心</h1>

        </div>
        <div class="top-nav">
          <span class="menu"><img src="images/menu.png" alt=""> </span>

          <ul>
            <li class="active"><a class="color1" href="index.html">首页</a></li>
            <li><a class="color2" href="games.html">游戏</a></li>
            <li><a class="color4" href="news.html">新闻</a></li>
            <li><a class="color6" href="contact.html">联系我们</a></li>
            <div class="clearfix"> </div>
          </ul>

          <!--script-->
          <script>
            $("span.menu").click(function(){
              $(".top-nav ul").slideToggle(500, function(){
              });
            });
          </script>

        </div>

        <div class="clearfix"> </div>
      </div>
    </div>
  </div>
</div>

<!--content-->
<div class="content">
  <div class="container" style="    background: url(images/cy.jpg);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    height: 600px;">
    <div class="content-top">
      <div class="wrap">
        <div class="main">
          <h1  style="    margin-top: 85px;
    margin-left: 400px;">欢迎来到成语组装游戏！</h1>
<div style="    margin-left: 443px;
    margin-top: 40px;">
          <span th:each="c:${chengyu}" th:text="${c}" class="cyspan" onclick="cy(this)">风</span>
         <span class="cyspan" onclick="cy(this)">一</span>
         <span class="cyspan" onclick="cy(this)">顺</span>
         <span class="cyspan" onclick="cy(this)">帆</span>
</div>
          <form method="post" action="/chengyu">
            <div style="margin: 20px auto;width: 240px;">
              <input id="cytext" type="text" th:value="${zzcy}" name="zzcy" style="width:192px"/>
              <button type="submit">确定</button>
            </div>
          </form>
         <p id="resultMessage" th:utext="${resultMessage}" style="padding:10px 20px;">恭喜您，拼接成功！</p>
        </div>
      </div>
    </div>

  </div>
</div>
<!---->
<div class="footer">
  <p class="footer-class">Copyright &copy; 2025.Sunys</p>
</div>

</body>
</html>